<?php

require_once 'smarty_lib/Smarty.class.php';
require_once 'lib/DBClass.php';
require_once 'lib/Member.php';

$smarty = new Smarty();
$acc = new Member();

$smarty->template_dir = 'template/';
$smarty->compile_dir = 'template_c/';


if(!$acc->validate_cookie()){
	$smarty->assign('error','Anda tidak mepunyai akses untuk membuka halaman ini');
	$smarty->display('index.html');
}else if(isset($_POST['edit'])){
	$smarty->assign('cookie', $acc->get_cookie());
	$smarty->assign('page','myaccount.html');
	$smarty->assign('title','Edit Account');

	$smarty->display('account.html');
}else{
	$smarty->assign('cookie', $acc->get_cookie());
	$smarty->assign('page','myaccount.html');
	$smarty->assign('title','My Account'); 

	$smarty->display('account.html');
}
?>